import Page
from Page import Launcher
from Base.Base import Base
from selenium.webdriver.common.by import By


class LauncherUserPage(Base):
    """
    桌面用户页页面
    """

    def __init__(self, driver):
        Base.__init__(self, driver)

        # 搜索框
        self.user_list_user_icon_img = (By.XPATH, Launcher.user_list_user_icon_img.format(1))

        # 搜索列表
        self.service_search_list_title_text = (By.XPATH, Launcher.service_search_list_title_text.format(1))

    def click_user(self, index=1):
        """
        根据索引点击用户头像

        :param index: 索引
        :return:
        """
        self.service_search_list_title_text = (By.XPATH, Launcher.service_search_list_title_text.format(1))
        self.click_element(self.user_list_user_icon_img)
